<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<html>
<body>
<script type="text/javascript">
	$(document).ready(function(){
		$("#orderby").val(${orderby});
	});
	
	function exportExcel(){
		$("#mallForm").attr("action","exportMall.do");
		$("#mallForm").sumbit();
	}
	
	function query(){
		$("#mallForm").attr("action","mallStat.do");
		$("#mallForm").sumbit();
	}
	
</script>
<form id="mallForm" class="form-inline" action="" method="get">
商品id：<input type="text" class="input-small" name="userGoodsId" value=""/>&nbsp;&nbsp;
排序方式：  <select name="orderby" id="orderby">
			<option value="0" id="" selected >按默认顺序</option>
		  	<option value="1" id="" selected >按销售数量降序</option>
		  	<option value="2" id="">按K币合计降序</option>
</select>&nbsp;&nbsp;
从
  <div class="datepicker input-append">
    <input data-format="yyyy-MM-dd" type="text" value="${beginDate}" name="beginDate"></input>
    <span class="add-on">
      <i data-time-icon="icon-time" data-date-icon="icon-calendar">
      </i>
    </span>
  </div>
  到
  <div class="datepicker input-append">
    <input data-format="yyyy-MM-dd" type="text" value="${endDate}" name="endDate"></input>
    <span class="add-on">
      <i data-time-icon="icon-time" data-date-icon="icon-calendar">
      </i>
    </span>
  </div>
  
  <button type="submit" class="btn" onClick="query()">查询</button>
  
  <button type="submit" class="btn" onClick="exportExcel()">导出excel</button>
  
</form>
<table class="table table-bordered">
  <thead>
    <tr>
      <th>序号</th>
      <th>商城id</th>
      <th>物品配置id</th>
      <th>商品名称</th>
      <th>销售数量</th>
      <th>K币-单价</th>
      <th>分贝-单价</th>
      <th>K币合计</th>
      <th>分贝合计</th>
      <th>过期时间</th>
    </tr>
  </thead>
  <tbody>
  <c:forEach var="m" items="${all.detailList}" varStatus="vs">
    <tr>
      <td>${vs.count}</td>
      <td>${m.mallId}</td>
      <td>${m.baseId}</td>
      <td>${m.name}</td>
      <td>${m.sellCount}</td>
      <td>${m.goldPrice}</td>
      <td>${m.silverPrice}</td>
      <td>${m.goldTotal}</td>
      <td>${m.silverTotal}</td>
      <td>${m.expireOption}</td>
    </tr>
  </c:forEach>
  </tbody>
</table>
<tags:page1 page="${page}" pageSize="${pageSize}" total="${all.total}" url="?beginDate=${beginDate}&endDate=${endDate}&userGoodsId=${userGoodsId}&orderby=${orderby }&page="/>
</body>
</html>